package com.atguigu.jvm1205;


class Person {
    private String personName;

    public String getPersonName() {
        return personName;
    }

    public void setPersonName(String personName) {
        this.personName = personName;
    }
}
/**
 * @author gcq
 * @Create 2020-12-02
 */
public class TestTransferValue {

    public void changeValue1(int age) {
        age =  30;
    }
    public void changeValue2(Person person) {
        person.setPersonName("xxxx");
    }
    public void changeValue3(String str) {
        str = "xxxx";
    }

    public static void main(String[] args) {
        TestTransferValue testTransferValue = new TestTransferValue();
        int age = 20;
        testTransferValue.changeValue1(age);
        System.out.println("**********age:" + age);

        Person person = new Person();
        person.setPersonName("www");
        testTransferValue.changeValue2(person);
        System.out.println("*********PersonName:" + person.getPersonName());

        String str = "aaa";
        testTransferValue.changeValue3(str);
        System.out.println("************str:" + str);
    }
}